import request from '@/utils/request'
import {praseStrEmpty} from "@/utils/project";

// 查询员工信息列表
export function listStaff(query) {
    return request({
        url: '/server/staff/list',
        method: 'get',
        params: query
    })
}

// 查询员工信息详细
export function getStaff(staffId) {
    return request({
        url: '/server/staff/' + praseStrEmpty(staffId),
        method: 'get'
    })
}

// 新增员工信息
export function addStaff(data) {
    return request({
        url: '/server/staff',
        method: 'post',
        data: data
    })
}

// 修改员工信息
export function updateStaff(data) {
    return request({
        url: '/server/staff',
        method: 'put',
        data: data
    })
}

// 删除员工信息
export function delStaff(staffId) {
    return request({
        url: '/server/staff/' + staffId,
        method: 'delete'
    })
}

// 导出员工信息
export function exportStaff(query) {
    return request({
        url: '/server/staff/export',
        method: 'get',
        params: query
    })
}
